package com.topvision.myviewtest.viewdrag.swipe;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;

import com.topvision.myviewtest.R;
import com.topvision.myviewtest.viewdrag.swipe.base.SlideActivity;
import com.topvision.myviewtest.viewdrag.swipe.interfaces.SlideMoveInterface;
import com.topvision.myviewtest.viewdrag.swipe.util.ActivityStackManager;


/**
 * @author lucy
 * @date 2018-04-23 13:46
 * @description //TODO
 */

public class Test2Activity extends SlideActivity implements SlideMoveInterface {


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        setSlideMoveListener(this);
    }

    public void click(View view) {
        startActivity(new Intent(this,Test2Activity.class));
    }

    @Override
    public void moving(int dx) {
        SlideActivity activity = (SlideActivity) ActivityStackManager.getInstance().getNextStack();
        activity.activityMoving(dx);
    }

    @Override
    public void resetPostion() {
        SlideActivity activity = (SlideActivity) ActivityStackManager.getInstance().getNextStack();
        activity.activityReseting();
    }

    @Override
    public void resumePostion() {
        SlideActivity activity = (SlideActivity) ActivityStackManager.getInstance().getNextStack();
        activity.activityResumeing();
    }
}
